/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ie.tcd.cs.railtickets.server.domain;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import static javax.persistence.GenerationType.IDENTITY;

/**
 *
 * @author Wenbo Sun
 */
@Entity
@Table(name = "agent")
public class Agent implements Serializable {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "agent_id")
    private long id;

    @Column(name = "agent_addr", unique = true, nullable = false)
    private String ipAddr;
    
    @Column(name = "agent_name")
    private String name;

    @Column(name = "graph_time")
    @Temporal(TemporalType.TIMESTAMP)
    private Date graphTime;

    public Agent() {
    }

    public Agent(long id) {
        this.id = id;
    }

    public Agent(String ipAddr, String name, Date graphTime) {
        this.ipAddr = ipAddr;
        this.name = name;
        this.graphTime = graphTime;
    }

    
    public Date getGraphTime() {
        return graphTime;
    }

    public void setGraphTime(Date graphTime) {
        this.graphTime = graphTime;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getIpAddr() {
        return ipAddr;
    }

    public void setIpAddr(String ipAddr) {
        this.ipAddr = ipAddr;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }



}
